From 58590ae3c495bb82aa056c02929b01efcc63a3ba Mon Sep 17 00:00:00 2001 From: Eh2406 Date: Sat, 27 Jan 2018 23:01:57 -0500 Subject: [PATCH] Send the links attribute to the registry --- src/cargo/core/manifest.rs | 1 + src/cargo/ops/registry.rs | 3 ++- src/cargo/util/toml/mod.rs | 1 + src/crates-io/lib.rs | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cargo/core/manifest.rs b/src/cargo/core/manifest.rs index ad85eb0b7..fa6909bd3 100644 --- a/src/cargo/core/manifest.rs +++ b/src/cargo/core/manifest.rs @@ -77,6 +77,7 @@ pub struct ManifestMetadata { pub repository: Option, // url pub documentation: Option, // url pub badges: BTreeMap>, + pub links: Option, } #[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] diff --git a/src/cargo/ops/registry.rs b/src/cargo/ops/registry.rs index 530519f60..90c386839 100644 --- a/src/cargo/ops/registry.rs +++ b/src/cargo/ops/registry.rs @@ -159,7 +159,7 @@ fn transmit(config: &Config, let ManifestMetadata { ref authors, ref description, ref homepage, ref documentation, ref keywords, ref readme, ref repository, ref license, ref license_file, - ref categories, ref badges, + ref categories, ref badges, ref links, } = *manifest.metadata(); let readme_content = match *readme { Some(ref readme) => Some(paths::read(&pkg.root().join(readme))?), @@ -194,6 +194,7 @@ fn transmit(config: &Config, license: license.clone(), license_file: license_file.clone(), badges: badges.clone(), + links: links.clone(), }, tarball); match publish { diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index fddd6ccd3..4a1366e0f 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -685,6 +685,7 @@ impl TomlManifest { keywords: project.keywords.clone().unwrap_or_default(), categories: project.categories.clone().unwrap_or_default(), badges: me.badges.clone().unwrap_or_default(), + links: project.links.clone(), }; let workspace_config = match (me.workspace.as_ref(), diff --git a/src/crates-io/lib.rs b/src/crates-io/lib.rs index be2849847..19d3e700c 100644 --- a/src/crates-io/lib.rs +++ b/src/crates-io/lib.rs @@ -55,6 +55,8 @@ pub struct NewCrate { pub license_file: Option, pub repository: Option, pub badges: BTreeMap>, + #[serde(default)] + pub links: Option, } #[derive(Serialize)] -- 2.30.2